<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/jquery.checkboxes.min.js"></script>
<script language="javascript" src="js/tableRowCheckboxToggle.js"></script>
<script>
$(document).ready(function(){
		//点击事件切换 全选取消状态
		$("#selectall").click( function (){ $("#grouplist").toggleCheckboxes(); });
	});
</script>

<title>列表</title>
</head>

<body>
<div id="man_zone">
<?php if($action=="edit"){?>
 <script type="text/javascript" charset="utf-8" src="./kindeditor/kindeditor.js"></script>
 <script type="text/javascript">
    KE.show({
        id : 'reply',
        cssPath : './kindeditor/index.css',
		urlType : 'absolute'
    });
  </script>
<form action="?action=edit" method="post" enctype="multipart/form-data">
<input name="gid" type="hidden" id="gid" value="<?php echo $gid;?>" />
<table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td width="15%" align="right" class="left_title_1">&nbsp;</td>
      <td width="85%">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">留言ID：</td>
      <td><input name="uid" type="text" id="uid" value="<?php echo $value['uid']?>"  disabled="disabled" /></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">留言用户名：</td>
      <td><input name="uname" type="text" id="uname" value="<?php echo $value['uname']?>"   disabled="disabled"/></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">留言内容：</td>
      <td><textarea name="msg" cols="50" rows="6"   disabled="disabled"><?php echo $value['msg']?></textarea></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">管理回复：</td>
      <td><textarea name="reply" cols="50" rows="10" id="reply"><?php echo $value['reply']?></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>

  </form>
  
  <?php }elseif(empty($action)){?>
  
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
      <td>
	    
    <input type="button" onclick="grouplist.submit();" name="Submit" value="删除选定" /></td>
      <td width="62%" align="right"><form id="seach" name="seach" method="get" action="">
         &nbsp;标题：
            <input name="title" type="text" id="title" size="15" />
          &nbsp;
            <input type="submit" name="Submit3" value="搜索" />
      </form>
      </td>
    </tr>
  </table>
<form method="post" action="?action=dels" name="grouplist" id="grouplist">
  <table width="99%" align="center"  border="0" cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <th width="2%"><label>
        <input type="checkbox" name="checkbox" value="checkbox" id="selectall" />
      </label></th>
      <th width="4%">编号</th>
      <th width="8%">会员ID</th>
      <th width="9%">会员名称</th>
      <th width="16%">留言时间</th>
      <th width="49%">留言内容</th>
      <th width="12%">操作</th>
    </tr>
	<?php if(is_array($dataarray)){foreach($dataarray as $value){?>
    <tr class="odd_row">
      <td align="center"><input type="checkbox" name="delids[]" value="<?php echo $value['gid']?>" /></td>
      <td><?php echo $value['gid']?></td>
      <td><?php echo $value['uid']?></td>
      <td><?php echo $value['uname']?></td>
      <td><?php echo date('Y-m-d H:i',$value['addtime'])?>&nbsp;&nbsp;</td>
      <td><?php echo substrs($value['msg'],80)?></td>
      <td>
	  <?php if($value['state']==1){?>
	  <a href="guestbook_list.php?action=update&amp;gid=<?php echo $value['gid']?>"><font color="#006633">禁用</font></a>
	  <?php }else{ ?>
	  <a href="guestbook_list.php?action=update&amp;gid=<?php echo $value['gid']?>"><font color="#FF0000">启用</a>
	  <?php };?>
	  |<a href="guestbook_list.php?action=edit&amp;gid=<?php echo $value['gid']?>">查看回复</a>|<a href="javascript:if(confirm('确实要删除吗?'))location='guestbook_list.php?action=del&gid=<?php echo $value['gid']?>'">删除</a></td>
    </tr>
	<?php }}else{?>
	<tr><td colspan=7>暂无数据..............</td></tr>
	<?php };?>
  </table>
  

  <div style="width:99%;margin:0px auto;">

  
    <?php echo multi($total,$pagesize,$page,"");?>
  </div>
  </form>
  <?php }?>
</div>
</body>
</html>
